package what.the.fun.jdbc;

import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;
import what.the.fun.domain.Campaign;

public class CampaignExtractor implements ResultSetExtractor<Campaign>{

	@Override
	public Campaign extractData(ResultSet arg0) throws SQLException,
			DataAccessException {
		
		Campaign campaign = new Campaign();
		campaign.setCampId(arg0.getString(1));
		campaign.setName(arg0.getString(2));
		campaign.setUserId(arg0.getString(3));
		
		return campaign;
	}

}
